package com.ccrfid.rmc6.service.alarm;

import com.ccrfid.rmc6.appconfig.exception.pojo.AppException;
import com.ccrfid.rmc6.entity.alarm.AlarmLocationTypeEntity;
import com.ccrfid.rmc6.entity.alarm.AlarmRuleEntity;
import com.ccrfid.rmc6.entity.alarm.AlarmRuleTemplateEntity;
import com.ccrfid.rmc6.pojo.dto.LocationAlarmRuleDto;
import com.ccrfid.rmc6.pojo.dto.alarm.AlarmRuleDto;
import com.ccrfid.rmc6.repository.search.SearchCriteria;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

import java.util.List;
import java.util.Set;

public interface AlarmRuleService {
    //如果布防类型/布防状态搜索条件不为空，则返回的布防的区域id
    Set<Long> getLocationIdList(List<Integer> alarmTypeList, Integer alarmStatus);
    //
    Page<LocationAlarmRuleDto> getAlarmLocations(SearchCriteria criteria, Pageable pageable);
    //
    List<AlarmRuleEntity> getAlarmRulesByLocationId(Long locationId);
    //
    LocationAlarmRuleDto getLocationAlarmRules(Long locationId);
    //获取某个区域类型允许设置的布控类型
    List<AlarmLocationTypeEntity> getLocationAlarmTypes(Integer locationType);
    //
    AlarmRuleEntity getAlarmRule(Long alarmRuleId);
    //
    AlarmRuleEntity createAlarmRule(AlarmRuleEntity entity) throws AppException;
    //
    List<AlarmRuleEntity> batchCreateAlarmRules2LocationType(Integer locationType, AlarmRuleEntity entity);
    //
    AlarmRuleEntity updateAlarmRule(Long alarmRuleId, AlarmRuleEntity entity) throws AppException;
    //
    Boolean deleteAlarmRule(Long alarmRuleId) throws AppException;
    //
    List<AlarmRuleTemplateEntity> getAlarmRuleTemplates(SearchCriteria criteria, Sort sort);
    //
    AlarmRuleTemplateEntity getAlarmRuleTemplate(Long templateId);
    //
    AlarmRuleTemplateEntity createAlarmRuleTemplate(AlarmRuleTemplateEntity entity);
    //
    AlarmRuleTemplateEntity updateAlarmRuleTemplate(Long templateId, AlarmRuleTemplateEntity entity) throws AppException;
    //
    Boolean deleteAlarmRuleTemplate(Long templateId) throws AppException;
    //
    String getAlarmRuleTypeName(Integer alarmRuleType);
    //
    List<AlarmRuleEntity> getAllAlarmRules();

    //获取互监告警规则
    List<AlarmRuleEntity> getMutualAlarmRuleList();

    //获取所有告警规则名称
    List<String> getAllAlarmRuleName();

    //怀化定制功能-查询app布控规则
    List<AlarmRuleDto> getAlarmRuleForApp();

    Boolean batchDeleteAlarmRule(List<Long> alarmRuleIdList) throws AppException;

}
